package com.msb.springboot_mybatis.controller;

import com.msb.springboot_mybatis.entity.Account;
import com.msb.springboot_mybatis.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author sunpeng
 * @Date 2021-07-12 14:29
 */
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/queryAccount")
    public List<Account> queryAccount(){
        return accountService.queryAccount();
    }

    @GetMapping("/pageAccount")
    public List<Account> pageAccount(Integer pageNum, Integer pageSize){
        return accountService.pageAccount(pageNum, pageSize);
    }
}
